package com.swings.builder;

import java.io.File;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;

import org.apache.log4j.Logger;

import com.swings.componants.Application;

/**
 * <p>
 * <b>Overview:</b>
 * <p>
 * 
 * 
 * <pre>
 * Creation date: Feb 16, 2015
 * @author Amit Kshirsagar
 * @version 1.0
 * @since
 * 
 * <p><b>Modification History:</b><p>
 * 
 * 
 * </pre>
 */

public class JComponantBuilder {
	static Logger log = Logger.getLogger(JComponantBuilder.class.getName());

	public static Application application = null;

	public static void parseDom2Componants() {
		try {

			File file = new File("./conf/MyUtilityApplicationComponants.xml");
			JAXBContext jaxbContext = JAXBContext
					.newInstance(Application.class);

			Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
			application = (Application) jaxbUnmarshaller.unmarshal(file);
		} catch (JAXBException e) {
			e.printStackTrace();
		}
	}
}
